﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bread.Utility.Primitive;

public static partial class Extensions
{
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool IsEqual(this float v, float f, float eps = 0.0000001f)
    {
        return Math.Abs(v - f) < eps;

    }

    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool IsEqual(this double v, double f, double eps = 0.0000001f)
    {
        return Math.Abs(v - f) < eps;
    }
}
